package com.howells.time.base.http;

import com.howells.time.base.utils.JsonUtils;
import com.zhy.http.okhttp.callback.Callback;

import java.io.IOException;
import java.util.Map;

import okhttp3.Response;

/**
 * Created by Administrator on 2016.4.6.
 */
public abstract class JsonCallback extends Callback<Map<String, Object>> {

    @Override
    public Map<String, Object> parseNetworkResponse(Response response, int id) throws IOException {
        String body = response.body().string();
        Map<String, Object> info = JsonUtils.Json2Map(body);
        return info;
    }

}
